home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 1 (Walnut Creek)
/
Aminet - June 1993 [Walnut Creek].iso
/
usenet
/
sources
/
volume91
/
utilitys
/
findisk3
/
part01
/
FindDisk3.doc
< prev
next >
Wrap
Text File
|
1991-11-20
|
9KB
|
234 lines
FindDisk3.3 The Workbench version.
A Public Domain Program by Ross MacGregor.
The source was compiled with the Manx compiler.
(It shouldn't need much, if any, work to compile with Lattice)
Most people that own Amiga's soon accumulate a *GREAT* collection of
3-&-1/2 '' disks filled with lots and lots of PD software. And I'm sure
that many people still go through the same time-consuming process I use to
when finding a certain program [ I think it's on this disk...no maybe this
one...lets try this one...it must be here...I guess not...argggh! $#@#%! ].
If you have been looking to organize your disks a little better, this may
be just what you need. I have seen other disk cataloging programs but
they looked BIG and complicated.
I wanted a simple, unintrusive CLI command that would tell me on what disk
such-n-such a program could be found.
So I created a CLI command FD that did just that. This is the workbench
version of that program, but it will still search for strings given as
CLI arguments.
Type> FindDisk3.3 ; And the its display window is opened up.
[Please rename it if being used from the CLI.]
Type> FindDisk3.3 text ; And the disk's directory listing containing
'text' is displayed, just as if you executed
an ls. The text could also be the name of
the disk.
Multiple arguments can also be given so that the
directory, ARP_COMMANDS_DOC could be found with,
FD doc arp.
The DiskList
FD uses a file which by default is FindDisk:DiskList.
This is an almost ASCII file containing the listings of your disks.
[clarification of almost...]
To save space the listings are stored with the spaces ($20's) compacted
and some words of the listing tokenized. This results in a file with many
special (non-standard) control characters. It will not TYPE properly!
The DiskList can be loaded to ram: (yes, it's just a COPY but its also an
FD command, [LoadDL] ). This enables single drive users to capture the
dir listings of other disks. It frees up the drive and also speeds
things up if the DiskList gets large.
TempDL
When you capture the dir of a disk [SaveDir] it goes to an intermediate
file, TempDL, instead of going directly to DiskList (basically it's a
Shell> dir >>ram:TempDL ). This is for reasons of more efficient
updating of the DiskList. If someone had many disks to do, inserting the
directories into DiskList one at a time would take much longer than
inserting them all at once as FD does. Single drive users would also
need to reinsert their DiskList disk after each [SaveDir]!
You must do an [UpdateDL] or [SaveDL] to update the DiskList.
[Update] will update the current DiskList. If DiskList was loaded to
ram: the current one is considered there, otherwise it updates the disk
DiskList.
[SaveDL] will copy the ram:DiskList to its disk location after doing an
update (as above). If the current DiskList is not in RAM it will only do
an update.
FindDisk3.3
---------------
[ _ ] The display window opens up with the string input gadget
activated. Here you can type in several text strings
with space separaters followed by return.
If these strings are all found on the same line of a
directory listing in the DiskList then that dir listing is
printed.
If the search text is preceded with an ! with no spaces in
between then the search is case sensitive, otherwise it is
not.
The disk name can also be used to list its contents.
Typing [q] [return] will quit the display when the "more"
prompt is displayed.
*s The commands below marked with '*s' will look at the string
input gadget for input.
When typing in one of these strings you must remember not
to hit the return key, otherwise, the program will think it
is a search string.
[LoadDL] Loads DiskList to ram: by default or to an alternate
path/name if specified by the environment variable DLTEMP .
The DiskList in RAM then becomes the current DiskList.
DiskList must be now be saved to disk using [SaveDL] if any
changes are made because [UpdateDL] will only update the
RAM DiskList.
[SaveDir] Appends in ram:TempDL the ASCII (root) directory listing
of the disk in drive DF0: by default. It takes it from
an alternate drive if specified by the environment
variable DLDISK.
*s It will also capture the listing of a disk or
directory path specified by the string input gadget.
[UpdateDL] This will update the current DiskList with
the contents of the temporary file TempDL.
[SaveDL] Does an update (as above) then if the DiskList is in RAM,
it is copied to its disk location. DiskList and TempDL are
removed from RAM.
[NewDL] Creates a new DiskList, by deleting the contents of the
Current DiskList.
*s [RemDir] This will remove the disk listing in DiskList that matches
the diskname in the input string.
Switches:
[Root Directory/Sub-Directories]
When 'Sub-Directories' is selected, the SaveDir command will recursively
capture any sub-directories in the directory it's listing.
When 'Root Directory' is selected, SaveDir will only capture the root
directory.
[Standard Display/Short Form]
When 'Short Form' is selected, only the lines that contain the search
string will be output on the display window.
Environment Variables
---------------------
FindDisk will check for the three environment variables listed below.
*Notice* that DLDISK and DLTEMP require the name of DiskList also!
Variable = Default setting if not specified.
DLDISK = FindDisk:Disklist
------
Disk storage location/name. This is where FD expects to find
the permanent DiskList. It must be on a floppy or hard drive.
DLTEMP = RAM:DiskList
------
Ram storage location/name. This is where FD will copy the
permanent DiskList to on a [LoadDL]. This makes the DiskList
resident and frees up the drive.
DLDRIVE = DF0:
-------
Captures directory of this drive on a [SaveDir] command.
DiskList Format
---------------
The DiskList is stored in a compacted form which presently:
below: { unskrunched } => { skrunched }
[] is a byte of memory
* compacts strings of spaces
{ [$20] [$20] [$20] [$20] [$20] } => { [SKRUNCHAR] [30+5] }
{ [$20] [$20] } => { [$20] [$20] }
* the STARTSTR is compacted
{ STARTSTR } => { [STARTCHAR] }
BUG FIXES / UPDATE HISTORY
--------------------------
FindDisk3.3 The New Look!
Extra character at end of the message display problem fixed.
Function getstr() was not freeing all of its allocated
memory.
Add/RemoveGadget() calls were not needed so they were
removed.
More input buffer write out of bounds.
Use of strncpy() was causing problems because of padding.
Remove limit of DiskList size (it was a fair size but
unnecessary).
FindDisk3.2 Default file for environment variable DLDISK changed
to FindDisk:DiskList.
FindDisk3.1 Fixed search lockup. Reproducible when a small DiskList
was used.
Option created to capture all sub-directories on a given
disk when adding it to the DiskList.
A sub-directory can now be specified as a parameter
to SaveDir.
New "Short Form" listing option.
Some 3.0 error returns were not propery freeing up
allocated resouces. These were accordingly squashed.
FindDisk3.0 First release.